/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "include/dynamic_range_compression.h"

#include <stdlib.h>
#include <string.h>

#include "drc_core.h"

DrcHandle* Drc_Create() {
  DynamicRangeCompressionC* self = malloc(sizeof(DynamicRangeCompressionC));
  self->initFlag = 0;
  return (DrcHandle*)self;
}

void Drc_Free(DrcHandle* DRC_inst) {
  free(DRC_inst);
}

int Drc_Init(DrcHandle* DRC_inst, uint32_t fs, int threshold1, float ratio, int threshold2, int mode, float supPoint, float supExp) {
    return Drc_InitCore((DynamicRangeCompressionC*)DRC_inst, fs, threshold1, ratio, threshold2, mode, supPoint, supExp);
}

void Drc_Process(DrcHandle* DRC_inst,
                      const float* const* spframe,
                      float* const* outframe) {
  Drc_ProcessCore((DynamicRangeCompressionC*)DRC_inst, spframe, outframe);
}
